package org.example.erp.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.example.erp.domain.SysUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;

/**
 * @author 28254
 * @description 针对表【sys_user(用户表)】的数据库操作Mapper
 * @createDate 2024-10-07 18:51:18
 * @Entity org.example.backend.domain.SysUser
 */
public interface SysUserMapper extends BaseMapper<SysUser> {
    IPage<SysUser> findUserByDept(@Param(value = "page") Page<SysUser> page,
                                  @Param(value = "username") String username,
                                  @Param(value = "phone") String phone,
                                  @Param(value = "status") String status,
                                  @Param(value ="startTime") String startTime,
                                  @Param(value = "endTime") String endTime,
                                  @Param(value = "depts") List<Integer> depts);
    void deleteUserByIds(@Param(value = "userIds") List<Integer> userIds);

    void insertPost(@Param(value = "userId")Integer userId,@Param(value = "postIds") List<Integer> postIds);

    void insertRole(@Param(value = "userId")Integer userId,@Param(value = "roleIds") List<Integer> roleIds);

    void insertDept(@Param(value = "userId")Integer userId,@Param(value = "deptId") Integer deptId);

    SysUser findUserById(@Param(value = "userId") Integer userId);

   List<Integer> findDeptList(@Param(value = "deptId") Integer deptId);


    Page<SysUser> findSelectUser(IPage<SysUser> page, @Param("roleId")  Integer roleId, @Param("username") String username,@Param("phone") String phone);


}




